From pixar!sun!prony.Colorado.EDU!clarkmp@ucbvax.berkeley.edu Mon Jan 20 12:00:35 1992
Return-Path: <pixar!sun!prony.Colorado.EDU!clarkmp@ucbvax.berkeley.edu>
Received: from ames.arc.nasa.gov by ra-next.arc.nasa.gov (NeXT-1.0 (From Sendmail 5.52)/NeXT-1.0)
	id AA01551; Mon, 20 Jan 92 12:00:31 PST
Received: from ucbvax.Berkeley.EDU by ames.arc.nasa.gov (5.65c/1.21)
	with SMTP id AA27517 for <woo@ames.arc.nasa.gov>
	on Mon, 20 Jan 1992 07:14:46 -0800
Received: from pixar.UUCP by ucbvax.Berkeley.EDU (5.63/1.43)
	id AA11844; Mon, 20 Jan 92 11:31:40 -0800
Received: from sun.UUCP by pixar (4.1/SMI-4.1)
	id AA07639; Sat, 18 Jan 92 12:14:59 PST
Received: from Sun.COM (sun-barr) by sun.Eng.Sun.COM (4.1/SMI-4.1)
	id AA12923; Sat, 18 Jan 92 11:52:36 PST
Received: from boulder.Colorado.EDU by Sun.COM (4.1/SMI-4.1)
	id AA26290; Sat, 18 Jan 92 11:53:27 PST
Received: from prony.Colorado.EDU by boulder.Colorado.EDU with SMTP id AA04647
  (5.65c/IDA-1.4.4 for <bug-gnuplot%pixar.uucp@sun.com>); Sat, 18 Jan 1992 12:53:25 -0700
Received: by prony.Colorado.EDU (cu.generic.890828)
From: Michael Clark <pixar!sun!prony.Colorado.EDU!clarkmp@ucbvax.berkeley.edu>
Message-Id: <9201181953.AA11256@prony.Colorado.EDU>
Subject: gnuplot and eepic
To: pixar!bug-gnuplot@ames.arc.nasa.gov
Date: Sat, 18 Jan 92 12:53:26 MST
Mailer: Elm [revision: 66.25]
Status: RO

Dave,
  I tried messing with the linetypes in eepic.trm but had problems with the
spacing of the dots and dashes.  I gather this problem has be noted before.
Therefore, I opted to use linespoints curves in my figures.  This led to
a problem.  If I used many samples to describe the curve, the symbols were
too closely spaced.  When I used fewer samples, the curves lost their 
smoothness (as expected).  What I really needed was a way to plot every 
n^th point so that I could get I smooth curve without tons of symbols.  So,
I hacked to the code to do the following.

Instead of just having two params following the style param, there are now
4:

1: line_type
2: point_type
3: point_skip   - gives the number of data samples per plotted point
4: point_offs   - gives the sample number on which to plot the first point

Thus points are plotted only for the samples n satisfying 
        n = point_skip*i + point_offs 
for some non-negative integer i.

This seems to have done the trick.  Thanks for your help.  Here are 
the diffs if anyone else is interested.

--------------------------------------------------------------------------

*** command.c.old       Fri Jan 17 15:41:38 1992
--- command.c   Sat Jan 18 12:47:04 1992
***************
*** 178,185 ****
                if (c_token < num_tokens)       /* something after command */
                        if (equals(c_token,";"))
                                c_token++;
!                       else
!                                       int_error("';' expected",c_token);
        }
  }
  
--- 178,185 ----
                if (c_token < num_tokens)       /* something after command */
                        if (equals(c_token,";"))
                                c_token++;
!                       else 
!                                       int_error("';' expected",c_token); 
        }
  }
  
***************
*** 1302,1307 ****
--- 1302,1309 ----
                  printf("Plot title: '%s'\n", this_plot->title);
                  printf("Line type %d\n", this_plot->line_type);
                  printf("Point type %d\n", this_plot->point_type);
+                 printf("Point skip %d\n", this_plot->point_skip);
+                 printf("Point offset %d\n", this_plot->point_offs);
                  printf("max points %d\n", this_plot->p_max);
                  printf("current points %d\n", this_plot->p_count);
                  printf("\n");
***************
*** 1450,1455 ****
--- 1452,1459 ----
    
                        this_plot->line_type = line_num;
                        this_plot->point_type = point_num;
+                       this_plot->point_skip = 1;
+                       this_plot->point_offs = 1;
  
                        if (almost_equals(c_token,"w$ith")) {
                                if (parametric && xparam) 
***************
*** 1466,1471 ****
--- 1470,1483 ----
                                struct value t;
                                this_plot->point_type = (int)real(const_express(&t))-1;
                        }
+                       if ( !equals(c_token,",") && !END_OF_COMMAND ) {
+                               struct value t;
+                               this_plot->point_skip = (int)real(const_express(&t));
+                       }
+                       if ( !equals(c_token,",") && !END_OF_COMMAND ) {
+                               struct value t;
+                               this_plot->point_offs = (int)real(const_express(&t));
+                       }
                        if ( (this_plot->plot_style == POINTS) ||
                                 (this_plot->plot_style == LINESPOINTS) ||
                                 (this_plot->plot_style == ERRORBARS) )
***************
*** 1638,1643 ****
--- 1650,1663 ----
                        }
  
                        /* line and point types were handled above */
+                       if ( !equals(c_token,",") && !END_OF_COMMAND ) {
+                               struct value t;
+                               (void)real(const_express(&t));
+                       }
+                       if ( !equals(c_token,",") && !END_OF_COMMAND ) {
+                               struct value t;
+                               (void)real(const_express(&t));
+                       }
                        if ( !equals(c_token,",") && !END_OF_COMMAND ) {
                                struct value t;
                                (void)real(const_express(&t));
*** graphics.c.old      Fri Jan 17 14:58:01 1992
--- graphics.c  Fri Jan 17 16:01:02 1992
***************
*** 815,821 ****
      int x,y;
      struct termentry *t = &term_tbl[term];
  
!     for (i = 0; i < plot->p_count; i++) {
           if (plot->points[i].type == INRANGE) {
                  x = map_x(plot->points[i].x);
                  y = map_y(plot->points[i].y);
--- 815,821 ----
      int x,y;
      struct termentry *t = &term_tbl[term];
  
!     for (i = plot->point_offs; i < plot->p_count; i=i+plot->point_skip) {
           if (plot->points[i].type == INRANGE) {
                  x = map_x(plot->points[i].x);
                  y = map_y(plot->points[i].y);
*** plot.h.old  Fri Jan 17 15:11:18 1992
--- plot.h      Fri Jan 17 15:42:50 1992
***************
*** 353,358 ****
--- 353,360 ----
        char *title;
        int line_type;
        int point_type;
+       int point_skip;         /* plot only every skip^th point with linespoints */ 
+       int point_offs;         /* start with linesp_offs^th point */
        int p_max;                                      /* how many points are allocated */
        int p_count;                                    /* count of points in points */
        struct coordinate *points;

--
Michael Clark
University of Colorado                  Phone:  (303) 492-2759
Campus Box 425                          Fax:    (303) 492-2758
Boulder, CO 80309-0425

